import Taro, { Component } from '@tarojs/taro'
import { View, Text, Image, Picker, Swiper, SwiperItem, Button } from '@tarojs/components'
import {AtButton, AtTabs, AtInput, AtTabsPane, AtRadio} from 'taro-ui'
import './editInspect.scss'
import reactMixin  from 'react-mixin'
import myJs from './editInspectJs.js'

export default class EditInspect extends Component {
    constructor () { 
        super(...arguments); 
        this.state = this.getData(); 
    }
    config = {
        navigationBarTitleText: '修改检查数据'
    }

    init() {
        this.state.case_detail.id = this.$router.params.id;
        this.setState({
            case_detail: this.state.case_detail
        });

        this.getCase_detail();
    }

    cradioClick(t, i1, i2) {
        if(!this.state.inspect_data[t][i1][i2]) {
            this.state.inspect_data[t][i1][i2] = 'true';
        } else {
            this.state.inspect_data[t][i1][i2] = '';
        }
        
        this.setState({
            inspect_data: this.state.inspect_data
        });
    }

    render () {
        return (
            <View className='editInspect'>
                <View className="subject">
                    <AtTabs current={this.state.tabIndex} tabList={[{ title: '右眼' }, { title: '左眼' }]} onClick={this.handleChange.bind(this, 'tabIndex')} swipeable={false}>
                        <AtTabsPane current={this.state.tabIndex} index={0}>
                            <View>
                                <View className={this.state.eye_template.displays['裸眼视力'] ? 'component-panel' : 'hidden'}><AtInput placeholder='请输入' value={this.state.inspect_data.v2['裸眼视力'].v1} onChange={this.handleChange.bind(this, 'inspect_data.v2.裸眼视力.v1')} title='裸眼视力' type='text'/></View>
                                <View className={this.state.eye_template.displays['矫正视力'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">矫正视力</View>
                                    <View className="component flex-start">
                                        <AtInput 
                                            placeholder= ""
                                            value={this.state.inspect_data.v2['矫正视力'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.矫正视力.v1')}  
                                            type='text' className="b-input"/>
                                        <Text className="c-txt">DS/</Text>
                                        <AtInput 
                                            placeholder= ""
                                            value={this.state.inspect_data.v2['矫正视力'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.矫正视力.v2')}  
                                            type='text' className="b-input"/>
                                        <Text className="c-txt">DC X</Text>
                                        <AtInput 
                                            placeholder= ""
                                            value={this.state.inspect_data.v2['矫正视力'].v3} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.矫正视力.v3')}  
                                            type='text' className="b-input"/>
                                        <Text className="c-txt">° -></Text>
                                        <AtInput 
                                            placeholder= ""
                                            value={this.state.inspect_data.v2['矫正视力'].v4} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.矫正视力.v4')}  
                                            type='text' className="b-input"/>
                                    </View>
                                </View>

                                <View className={this.state.eye_template.displays['光定位'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">光定位</View>
                                    <AtRadio value={this.state.inspect_data.v2['光定位'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.光定位.v1')}
                                        options={[
                                            { label: '准', value: '准' },
                                            { label: '不准', value: '不准' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['色觉'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">色觉</View>
                                    <AtRadio value={this.state.inspect_data.v2['色觉'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.色觉.v1')}
                                        options={[
                                            { label: '红绿可辨', value: '红绿可辨' },
                                            { label: '红绿不可辨', value: '红绿不可辨' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['眼睑'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">眼睑</View>
                                    <AtRadio value={this.state.inspect_data.v2['眼睑'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.眼睑.v1')}
                                        options={[
                                            { label: '正常', value: '正常' },
                                            { label: '红肿', value: '红肿' },
                                            { label: '内翻', value: '内翻' },
                                            { label: '外翻', value: '外翻' },
                                            { label: '下垂', value: '下垂' },
                                            { label: '其他', value: '其他' },
                                        ]}
                                    />
                                    <AtInput 
                                            value={this.state.inspect_data.v2['眼睑'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.眼睑.v2')}  
                                            type="text" placeholder="选择其他时需要填写"/>
                                </View>

                                <View className={this.state.eye_template.displays['睫毛'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">睫毛</View>
                                    <AtRadio value={this.state.inspect_data.v2['睫毛'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.睫毛.v1')}
                                        options={[
                                            { label: '正常', value: '正常' },
                                            { label: '倒睫', value: '倒睫' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['眼位'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">眼位</View>
                                    <View className="component flex-start">
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v1')} className={this.state.inspect_data.v2['眼位'].v1?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v1')} className={this.state.inspect_data.v2['眼位'].v1?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                        <Text className="c-txt">眼位正</Text>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v2')} className={this.state.inspect_data.v2['眼位'].v2?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v2')} className={this.state.inspect_data.v2['眼位'].v2?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                        <Text className="c-txt">外斜 </Text>
                                        <AtInput 
                                            value={this.state.inspect_data.v2['眼位'].v2 && this.state.inspect_data.v2['眼位'].v2 != 'true'?this.state.inspect_data.v2['眼位'].v2:''} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.眼位.v2')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">°</Text>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v3')} className={this.state.inspect_data.v2['眼位'].v3?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v3')} className={this.state.inspect_data.v2['眼位'].v3?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                        <Text className="c-txt">内斜</Text>
                                        <AtInput 
                                            value={this.state.inspect_data.v2['眼位'].v3 && this.state.inspect_data.v2['眼位'].v3 != 'true'?this.state.inspect_data.v2['眼位'].v3:''} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.眼位.v3')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">°</Text>
                                    </View>
                                </View>

                                <View className={this.state.eye_template.displays['眼球'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">眼球</View>
                                    <AtRadio value={this.state.inspect_data.v2['眼球'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.眼球.v1')}
                                        options={[
                                            { label: '正常', value: '正常' },
                                            { label: '异常', value: '异常' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['结膜'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">结膜</View>
                                    <AtRadio value={this.state.inspect_data.v2['结膜'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.结膜.v1')}
                                        options={[
                                            { label: '正常', value: '正常' },
                                            { label: '轻充血', value: '轻充血' },
                                            { label: '明显充血', value: '明显充血' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['泪道冲洗'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">泪道冲洗</View>
                                    <AtRadio value={this.state.inspect_data.v2['泪道冲洗'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.泪道冲洗.v1')}
                                        options={[
                                            { label: '通畅', value: '通畅' },
                                            { label: '不通无分泌物', value: '不通无分泌物' },
                                            { label: '脓性分泌物', value: '脓性分泌物' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['胬肉'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">胬肉</View>
                                    <AtRadio value={this.state.inspect_data.v2['胬肉'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.胬肉.v1')}
                                        options={[
                                            { label: '无', value: '无' },
                                            { label: '至角膜缘', value: '至角膜缘' },
                                            { label: '角膜缘与瞳孔圆之间', value: '角膜缘与瞳孔圆之间' },
                                            { label: '至瞳孔缘', value: '至瞳孔缘' },
                                            { label: '越过瞳孔缘', value: '越过瞳孔缘' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['角膜'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">角膜</View>
                                    <AtRadio value={this.state.inspect_data.v2['角膜'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.角膜.v1')}
                                        options={[
                                            { label: '透明', value: '透明' },
                                            { label: '云翳', value: '云翳' },
                                            { label: '斑翳', value: '斑翳' },
                                            { label: '白斑', value: '白斑' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['前房'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-panel">
                                        <View className="component-label">前房</View>
                                        <AtRadio value={this.state.inspect_data.v2['前房'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.前房.v1')}
                                            options={[
                                                { label: '正常', value: '正常' },
                                                { label: '浅', value: '浅' }
                                            ]}
                                        />
                                    </View>
                                    <View className="component flex-start">
                                        <Text className="c-txt">轴深</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v2['前房'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.前房.v2')}  
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">CT</Text>
                                        <Text className="c-txt">   周深</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v2['前房'].v3} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.前房.v3')}  
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">CT</Text>
                                    </View>
                                </View>
                                <View className={this.state.eye_template.displays['虹膜'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">虹膜</View>
                                    <AtRadio value={this.state.inspect_data.v2['虹膜'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.虹膜.v1')}
                                        options={[
                                            { label: '纹理清', value: '纹理清' },
                                            { label: '部分萎缩', value: '部分萎缩' },
                                            { label: '后粘连', value: '后粘连' },
                                            { label: '可见新生血管', value: '可见新生血管' },
                                            { label: '其他', value: '其他' },
                                        ]}
                                    />
                                    <AtInput 
                                            value={this.state.inspect_data.v2['虹膜'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.虹膜.v2')} 
                                            type="text" placeholder="选择其他时需要填写"/>
                                </View>

                                <View className={this.state.eye_template.displays['瞳孔'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-panel">
                                        <View className="component-label">瞳孔</View>
                                        <AtRadio value={this.state.inspect_data.v2['瞳孔'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.瞳孔.v1')}
                                            options={[
                                                { label: '对光反射正常', value: '对光反射正常' },
                                                { label: '对光反射迟钝', value: '对光反射迟钝' },
                                                { label: '对光反射消失', value: '对光反射消失' },
                                                { label: '圆', value: '圆' },
                                                { label: '不圆', value: '不圆' }
                                            ]}
                                        />
                                    </View>
                                    {/*<View className="component flex-start">
                                        <Text className="c-txt">瞳孔直径</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v2['瞳孔直径'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.瞳孔直径.v2')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">mm</Text>
                                    </View>*/}
                                </View>
                                <View className={this.state.eye_template.displays['晶状体'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">晶状体</View>
                                    <View className="component flex-start">
                                        <Text className="c-txt">C</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v2['晶状体'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.晶状体.v1')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">N</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v2['晶状体'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.晶状体.v2')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">P</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v2['晶状体'].v3} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.晶状体.v3')} 
                                            type='text' className="c-input"/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '晶状体', 'v4')} className={this.state.inspect_data.v2['晶状体'].v4?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '晶状体', 'v4')} className={this.state.inspect_data.v2['晶状体'].v4?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                        <Text className="c-txt">IOL</Text>
                                    </View>
                                </View>
                                
                                <View className={this.state.eye_template.displays['玻璃体'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">玻璃体</View>
                                    <AtRadio value={this.state.inspect_data.v2['玻璃体'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.玻璃体.v1')}
                                        options={[
                                            { label: '清晰', value: '清晰' },
                                            { label: '混浊', value: '混浊' },
                                            { label: '不能窥入', value: '不能窥入' },
                                            { label: '其他', value: '其他' },
                                        ]}
                                    />
                                    <AtInput 
                                            value={this.state.inspect_data.v2['玻璃体'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.玻璃体.v2')} 
                                            type="text" placeholder="选择其他时需要填写"/>
                                </View>

                                <View className={this.state.eye_template.displays['眼底'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-panel">
                                        <View className="component-label">眼底</View>
                                        <AtRadio value={this.state.inspect_data.v2['眼底'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.眼底.v1')}
                                            options={[
                                                { label: '眼底正常', value: '眼底正常' },
                                                { label: '眼底模糊', value: '眼底模糊' },
                                                { label: '色正常', value: '色正常' },
                                                { label: '色淡', value: '色淡' },
                                                { label: '色苍白', value: '色苍白' },
                                                { label: '眼底窥不入', value: '眼底窥不入' },
                                                { label: '视网膜正常', value: '视网膜正常' },
                                                { label: '黄斑正常', value: '黄斑正常' },
                                                { label: '黄斑窥不清', value: '黄斑窥不清' }
                                            ]}
                                        />
                                    </View>
                                    
                                    <View className="component flex-start">
                                        <Text className="c-txt">视盘C/D</Text>
                                        <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v2['眼底'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.眼底.v2')} 
                                            type='text' className="c-input"/>
                                    </View>
                                </View>
                                <View className={this.state.eye_template.displays['眼压'] ? 'binglie' : 'hidden'}>
                                    <AtInput 
                                            className='aaa'
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v2['眼压'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.眼压.v2')} 
                                            title='眼压' type='text' maxLength='4'/>
                                            <View className="t">mmHg</View>
                                </View>
                                <View className={this.state.eye_template.displays['A超B超'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">A超B超</View>
                                    <AtRadio value={this.state.inspect_data.v2['A超B超'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v2.A超B超.v1')}
                                        options={[
                                            { label: '清晰', value: '清晰' },
                                            { label: '轻度混浊', value: '轻度混浊' },
                                            { label: '明显混浊', value: '明显混浊' },
                                            { label: '星状变性', value: '星状变性' },
                                            { label: '玻璃体后脱离', value: '玻璃体后脱离' },
                                            { label: '积血', value: '积血' },
                                            { label: '其他', value: '其他' },
                                        ]}
                                    />
                                    <AtInput 
                                            value={this.state.inspect_data.v2['A超B超'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.A超B超.v2')}
                                            type="text" placeholder="选择其他时需要填写"/>
                                    <View className="component flex-start">
                                        <Text className="c-txt">AL</Text>
                                        <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v2['A超B超'].v3} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.A超B超.v3')}
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">mm</Text>
                                    </View>
                                </View>
                                
                                <View className={this.state.eye_template.displays['拱高'] ? '' : 'hidden'}>
                                    <View className='form_item'>
                                        <View className='form_label'>拱高</View>
                                        <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v2['拱高'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.拱高.v1')}
                                            className='form_input'
                                            title='' 
                                            type='text'/>    
                                        <View className='form_unit'>微米</View>    
                                    </View>
                                </View>
                                
                                <View className={this.state.eye_template.displays['内皮细胞数'] ? 'i' : 'hidden'}>
                                    <View className='form_item'>
                                        <View className='form_label'>内皮细胞数</View>
                                        <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v2['内皮细胞数'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.内皮细胞数.v1')}
                                            className='form_input'
                                            title='' 
                                            type='text'/>    
                                        <View className='form_unit'>个/mm2</View>    
                                    </View>        
                                </View>
                                <View className={this.state.eye_template.displays['光焦度'] ? 'i' : 'hidden'}>
                                    <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v2['光焦度'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v2.光焦度.v1')}
                                            title='光焦度' type='text'/>
                                            <Text className="t">D</Text>
                                </View>
                            </View>
                        </AtTabsPane>
                        <AtTabsPane current={this.state.tabIndex} index={1} >
                            <View>
                                <View className={this.state.eye_template.displays['裸眼视力'] ? 'component-panel' : 'hidden'}><AtInput placeholder='请输入' value={this.state.inspect_data.v1['裸眼视力'].v1} onChange={this.handleChange.bind(this, 'inspect_data.v1.裸眼视力.v1')} title='裸眼视力' type='text'/></View>
                                <View className={this.state.eye_template.displays['矫正视力'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">矫正视力</View>
                                    <View className="component flex-start">
                                        <AtInput 
                                            placeholder= ""
                                            value={this.state.inspect_data.v1['矫正视力'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.矫正视力.v1')}  
                                            type='text' className="b-input"/>
                                        <Text className="c-txt">DS/</Text>
                                        <AtInput 
                                            placeholder= ""
                                            value={this.state.inspect_data.v1['矫正视力'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.矫正视力.v2')}  
                                            type='text' className="b-input"/>
                                        <Text className="c-txt">DC X</Text>
                                        <AtInput 
                                            placeholder= ""
                                            value={this.state.inspect_data.v1['矫正视力'].v3} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.矫正视力.v3')}  
                                            type='text' className="b-input"/>
                                        <Text className="c-txt">° -></Text>
                                        <AtInput 
                                            placeholder= ""
                                            value={this.state.inspect_data.v1['矫正视力'].v4} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.矫正视力.v4')}  
                                            type='text' className="b-input"/>
                                    </View>
                                </View>

                                <View className={this.state.eye_template.displays['光定位'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">光定位</View>
                                    <AtRadio value={this.state.inspect_data.v1['光定位'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.光定位.v1')}
                                        options={[
                                            { label: '准', value: '准' },
                                            { label: '不准', value: '不准' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['色觉'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">色觉</View>
                                    <AtRadio value={this.state.inspect_data.v1['色觉'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.色觉.v1')}
                                        options={[
                                            { label: '红绿可辨', value: '红绿可辨' },
                                            { label: '红绿不可辨', value: '红绿不可辨' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['眼睑'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">眼睑</View>
                                    <AtRadio value={this.state.inspect_data.v1['眼睑'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.眼睑.v1')}
                                        options={[
                                            { label: '正常', value: '正常' },
                                            { label: '红肿', value: '红肿' },
                                            { label: '内翻', value: '内翻' },
                                            { label: '外翻', value: '外翻' },
                                            { label: '下垂', value: '下垂' },
                                            { label: '其他', value: '其他' },
                                        ]}
                                    />
                                    <AtInput 
                                            value={this.state.inspect_data.v1['眼睑'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.眼睑.v2')}  
                                            type="text" placeholder="选择其他时需要填写"/>
                                </View>

                                <View className={this.state.eye_template.displays['睫毛'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">睫毛</View>
                                    <AtRadio value={this.state.inspect_data.v1['睫毛'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.睫毛.v1')}
                                        options={[
                                            { label: '正常', value: '正常' },
                                            { label: '倒睫', value: '倒睫' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['眼位'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">眼位</View>
                                    <View className="component flex-start">
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v1')} className={this.state.inspect_data.v1['眼位'].v1?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v1')} className={this.state.inspect_data.v1['眼位'].v1?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                        <Text className="c-txt">眼位正</Text>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v2')} className={this.state.inspect_data.v1['眼位'].v2?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v2')} className={this.state.inspect_data.v1['眼位'].v2?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                        <Text className="c-txt">外斜 </Text>
                                        <AtInput 
                                            value={this.state.inspect_data.v1['眼位'].v2 && this.state.inspect_data.v1['眼位'].v2 != 'true'?this.state.inspect_data.v1['眼位'].v2:''} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.眼位.v2')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">°</Text>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v3')} className={this.state.inspect_data.v1['眼位'].v3?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '眼位', 'v3')} className={this.state.inspect_data.v1['眼位'].v3?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                        <Text className="c-txt">内斜</Text>
                                        <AtInput 
                                            value={this.state.inspect_data.v1['眼位'].v3 && this.state.inspect_data.v1['眼位'].v3 != 'true'?this.state.inspect_data.v1['眼位'].v3:''} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.眼位.v3')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">°</Text>
                                    </View>
                                </View>

                                <View className={this.state.eye_template.displays['眼球'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">眼球</View>
                                    <AtRadio value={this.state.inspect_data.v1['眼球'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.眼球.v1')}
                                        options={[
                                            { label: '正常', value: '正常' },
                                            { label: '异常', value: '异常' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['结膜'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">结膜</View>
                                    <AtRadio value={this.state.inspect_data.v1['结膜'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.结膜.v1')}
                                        options={[
                                            { label: '正常', value: '正常' },
                                            { label: '轻充血', value: '轻充血' },
                                            { label: '明显充血', value: '明显充血' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['泪道冲洗'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">泪道冲洗</View>
                                    <AtRadio value={this.state.inspect_data.v1['泪道冲洗'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.泪道冲洗.v1')}
                                        options={[
                                            { label: '通畅', value: '通畅' },
                                            { label: '不通无分泌物', value: '不通无分泌物' },
                                            { label: '脓性分泌物', value: '脓性分泌物' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['胬肉'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">胬肉</View>
                                    <AtRadio value={this.state.inspect_data.v1['胬肉'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.胬肉.v1')}
                                        options={[
                                            { label: '无', value: '无' },
                                            { label: '至角膜缘', value: '至角膜缘' },
                                            { label: '角膜缘与瞳孔圆之间', value: '角膜缘与瞳孔圆之间' },
                                            { label: '至瞳孔缘', value: '至瞳孔缘' },
                                            { label: '越过瞳孔缘', value: '越过瞳孔缘' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['角膜'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">角膜</View>
                                    <AtRadio value={this.state.inspect_data.v1['角膜'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.角膜.v1')}
                                        options={[
                                            { label: '透明', value: '透明' },
                                            { label: '云翳', value: '云翳' },
                                            { label: '斑翳', value: '斑翳' },
                                            { label: '白斑', value: '白斑' }
                                        ]}
                                    />
                                </View>

                                <View className={this.state.eye_template.displays['前房'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-panel">
                                        <View className="component-label">前房</View>
                                        <AtRadio value={this.state.inspect_data.v1['前房'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.前房.v1')}
                                            options={[
                                                { label: '正常', value: '正常' },
                                                { label: '浅', value: '浅' }
                                            ]}
                                        />
                                    </View>
                                    <View className="component flex-start">
                                        <Text className="c-txt">轴深</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v1['前房'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.前房.v2')}  
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">CT</Text>
                                        <Text className="c-txt">   周深</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v1['前房'].v3} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.前房.v3')}  
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">CT</Text>
                                    </View>
                                </View>
                                <View className={this.state.eye_template.displays['虹膜'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">虹膜</View>
                                    <AtRadio value={this.state.inspect_data.v1['虹膜'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.虹膜.v1')}
                                        options={[
                                            { label: '纹理清', value: '纹理清' },
                                            { label: '部分萎缩', value: '部分萎缩' },
                                            { label: '后粘连', value: '后粘连' },
                                            { label: '可见新生血管', value: '可见新生血管' },
                                            { label: '其他', value: '其他' },
                                        ]}
                                    />
                                    <AtInput 
                                            value={this.state.inspect_data.v1['虹膜'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.虹膜.v2')} 
                                            type="text" placeholder="选择其他时需要填写"/>
                                </View>

                                <View className={this.state.eye_template.displays['瞳孔'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-panel">
                                        <View className="component-label">瞳孔</View>
                                        <AtRadio value={this.state.inspect_data.v1['瞳孔'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.瞳孔.v1')}
                                            options={[
                                                { label: '对光反射正常', value: '对光反射正常' },
                                                { label: '对光反射迟钝', value: '对光反射迟钝' },
                                                { label: '对光反射消失', value: '对光反射消失' },
                                                { label: '圆', value: '圆' },
                                                { label: '不圆', value: '不圆' }
                                            ]}
                                        />
                                    </View>
                                    {/*<View className="component flex-start">
                                        <Text className="c-txt">瞳孔直径</Text>
                                        <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v1['瞳孔直径'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.瞳孔直径.v2')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">mm</Text>
                                    </View>*/}
                                </View>
                                <View className={this.state.eye_template.displays['晶状体'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">晶状体</View>
                                    <View className="component flex-start">
                                        <Text className="c-txt">C</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v1['晶状体'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.晶状体.v1')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">N</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v1['晶状体'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.晶状体.v2')} 
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">P</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v1['晶状体'].v3} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.晶状体.v3')} 
                                            type='text' className="c-input"/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '晶状体', 'v4')} className={this.state.inspect_data.v1['晶状体'].v4?"hidden":"icon"} src={app.imageUri+'images/checkbox-u.png'}/>
                                        <Image onClick={this.cradioClick.bind(this, 'v1', '晶状体', 'v4')} className={this.state.inspect_data.v1['晶状体'].v4?"icon":"hidden"} src={app.imageUri+'images/checkbox-c.png'}/>
                                        <Text className="c-txt">IOL</Text>
                                    </View>
                                </View>
                                
                                <View className={this.state.eye_template.displays['玻璃体'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">玻璃体</View>
                                    <AtRadio value={this.state.inspect_data.v1['玻璃体'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.玻璃体.v1')}
                                        options={[
                                            { label: '清晰', value: '清晰' },
                                            { label: '混浊', value: '混浊' },
                                            { label: '不能窥入', value: '不能窥入' },
                                            { label: '其他', value: '其他' },
                                        ]}
                                    />
                                    <AtInput 
                                            value={this.state.inspect_data.v1['玻璃体'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.玻璃体.v2')} 
                                            type="text" placeholder="选择其他时需要填写"/>
                                </View>

                                <View className={this.state.eye_template.displays['眼底'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-panel">
                                        <View className="component-label">眼底</View>
                                        <AtRadio value={this.state.inspect_data.v1['眼底'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.眼底.v1')}
                                            options={[
                                                { label: '眼底正常', value: '眼底正常' },
                                                { label: '眼底模糊', value: '眼底模糊' },
                                                { label: '色正常', value: '色正常' },
                                                { label: '色淡', value: '色淡' },
                                                { label: '色苍白', value: '色苍白' },
                                                { label: '眼底窥不入', value: '眼底窥不入' },
                                                { label: '视网膜正常', value: '视网膜正常' },
                                                { label: '黄斑正常', value: '黄斑正常' },
                                                { label: '黄斑窥不清', value: '黄斑窥不清' }
                                            ]}
                                        />
                                    </View>
                                    
                                    <View className="component flex-start">
                                        <Text className="c-txt">视盘C/D</Text>
                                        <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v1['眼底'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.眼底.v2')} 
                                            type='text' className="c-input"/>
                                    </View>
                                </View>
                                <View className={this.state.eye_template.displays['眼压'] ? 'binglie' : 'hidden'}>
                                    <AtInput 
                                            className='aaa'
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v1['眼压'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.眼压.v2')} 
                                            title='眼压' type='text' maxLength='4'/>
                                            <View className="t">mmHg</View>
                                </View>
                                <View className={this.state.eye_template.displays['A超B超'] ? 'component-panel' : 'hidden'}>
                                    <View className="component-label">A超B超</View>
                                    <AtRadio value={this.state.inspect_data.v1['A超B超'].v1} onClick={this.handleChange.bind(this, 'inspect_data.v1.A超B超.v1')}
                                        options={[
                                            { label: '清晰', value: '清晰' },
                                            { label: '轻度混浊', value: '轻度混浊' },
                                            { label: '明显混浊', value: '明显混浊' },
                                            { label: '星状变性', value: '星状变性' },
                                            { label: '玻璃体后脱离', value: '玻璃体后脱离' },
                                            { label: '积血', value: '积血' },
                                            { label: '其他', value: '其他' },
                                        ]}
                                    />
                                    <AtInput 
                                            value={this.state.inspect_data.v1['A超B超'].v2} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.A超B超.v2')}
                                            type="text" placeholder="选择其他时需要填写"/>
                                    <View className="component flex-start">
                                        <Text className="c-txt">AL</Text>
                                        <AtInput 
                                            placeholder= "请输入"
                                            value={this.state.inspect_data.v1['A超B超'].v3} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.A超B超.v3')}
                                            type='text' className="c-input"/>
                                        <Text className="c-txt">mm</Text>
                                    </View>
                                </View>
                                
                                <View className={this.state.eye_template.displays['拱高'] ? '' : 'hidden'}>
                                    <View className='form_item'>
                                        <View className='form_label'>拱高</View>
                                        <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v1['拱高'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.拱高.v1')}
                                            className='form_input'
                                            title='' 
                                            type='text'/>    
                                        <View className='form_unit'>微米</View>    
                                    </View>
                                </View>
                                
                                <View className={this.state.eye_template.displays['内皮细胞数'] ? 'i' : 'hidden'}>
                                    <View className='form_item'>
                                        <View className='form_label'>内皮细胞数</View>
                                        <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v1['内皮细胞数'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.内皮细胞数.v1')}
                                            className='form_input'
                                            title='' 
                                            type='text'/>    
                                        <View className='form_unit'>个/mm2</View>    
                                    </View>        
                                </View>
                                <View className={this.state.eye_template.displays['光焦度'] ? 'i' : 'hidden'}>
                                    <AtInput 
                                            placeholder='请输入'
                                            value={this.state.inspect_data.v1['光焦度'].v1} 
                                            onChange={this.handleChange.bind(this, 'inspect_data.v1.光焦度.v1')}
                                            title='光焦度' type='text'/>
                                    <Text className="t">D</Text>
                                </View>
                            </View>
                        </AtTabsPane>
                    </AtTabs>
                </View>
                
                <AtButton type='primary' size='normal' full={true} className="bottom" onClick={this.updateCase_detail.bind(this)}>保存</AtButton>
            </View>
        );
    }
}

reactMixin.onClass(EditInspect, myJs);
